<div class="page-orderlist w clearfix">
	<div class="user-tips">您能采购的商品以您所在地区的物流营销中心实际库存为准。</div>
	<div ng-include="'catalog/view/theme/bhz/pc/modules/includes/usernav.html'" ng-controller="UserNavCtrl" class="bhz-user-nav-wrap"></div>
	<div class="orderlist-page-wrap">
		<div class="order-list-title">我的账期</div>
		<div class="order-header clearfix">
			<a href="javascript:void(0);" ng-click="switchTab('全部')" class="order-tab-title" ng-class="{'selected':selection.tab == '全部'}">全部</a>
		</div>
		<div class="orderlist-wrap">
			<ul class="order-list" ng-if="periodList[selection.tab] && periodList[selection.tab].length>0">
				<li class="order-item" ng-repeat="order in periodList[selection.tab]">
					<div class="order-item-title clearfix">
						<div class="left">{{order.date_added}}</div>
						<div class="left">订单号：{{order.order_id}}</div>
						<div class="left">百货栈<i class="icon-order"></i></div>
					</div>
					<div class="order-item-content clearfix">
						<table class="order-item-content-table">
							<tr>
								<td class="order-product-details">
									<div class="">
										<table class="one-table">
											<tr class="order-product-item" ng-repeat="orderProduct in order.product_detail">
												<td class="img"><img ng-src="{{orderProduct.image}}"></td>
												<td class="name"><div class="auto-cut-word-two-line">{{orderProduct.name}}</div></td>
											</tr>
										</table>
									</div>
								</td>
								<td class="order-userinfo">
									<div class="">
										{{order.name}}<i class="icon icon-user-lg"></i>
									</div>
								</td>
								<td class="order-price-wrap">
									<div class="">
										<div>应付</div>
										<div>{{order.total}}</div>
									</div>
								</td>
								<td class="order-status-wrap">
									<div class="">
										<div class="order-status {{order.status}}">{{order.status}}</div>
										<a class="order-item-content-link" href="javascript:void(0);" ng-click="gotoOrder(order.order_id)">查看详情</a>
									</div>
								</td>
								<td class="order-options">
									还款日期:
									<font color="red">{{order.pay_date}}</font>
									<div class="">
										<!-- <a class="option-btn option-pay" href="javascript:void(0);" ng-if="order.status == '待付款'" ng-click="gotoPay(order.order_id)">去支付</a> -->
										<a class="option-btn option-pay" href="javascript:void(0);" ng-if="order.status == '全部发货'" ng-click="confirmReceived(order.order_id)">确认收货</a>

										<a class="option-btn option-pay" href="javascript:void(0);" ng-if="order.luckydraw" ng-click="gotoLuckydraw(order)">幸运抽奖 </a>
										<div ng-if="order.luckydraw">剩余 {{order.luckydraw.left_times}} 次</div>
										<div style="margin-top:10px" ng-if="order.luckydraw&&order.luckydraw.hitted_prices.length>0">
											<div>恭喜您已抽中</div>
											<ul>
												<li ng-repeat="hp in order.luckydraw.hitted_prices">
													{{hp.price_name}} - {{hp.product_name}}
												</li>
											</ul>
										</div>
									</div>
								</td>
							</tr>
						</table>						
					</div>
				</li>
			</ul>
			<div class="empty-order" ng-if="!periodList[selection.tab] || periodList[selection.tab].length<1">
				<div>暂无相关订单</div>
			</div>
		</div>
	</div>
</div>

<script type="text/ng-template" id="confirmReceivedDialog.html">
  <div class="dialog confirm-dialog" ng-click="$event.stopPropagation();">
    <p class="title ngdialog-text-center">是否确认收货？</p>
    <div class="ngdialog-buttons">
      <button type="button" class="ngdialog-button ngdialog-button-secondary" ng-click="closeThisDialog(0);$event.stopPropagation()">取消</button>
      <button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="confirm(1);$event.stopPropagation()">确认</button>
    </div>
  </div>
</script>